/*============================================================================
 PROJECT: TalkWrench
 FILE:    PhotoPresentationCell.m
 AUTHOR:  MACBOOK PRO
 DATE:    2/23/13
 =============================================================================*/

/*============================================================================
 IMPORT
 =============================================================================*/
#import "PhotoPresentationCell.h"
#import "UIImageView+AFNetworking.h"

/*============================================================================
 PRIVATE MACRO
 =============================================================================*/

/*============================================================================
 PRIVATE INTERFACE
 =============================================================================*/


@implementation PhotoPresentationCell

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // Initialization code
    }
    return self;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)awakeFromNib {
    [super awakeFromNib];
    self.transform = CGAffineTransformMakeRotation(M_PI_2);
    self.photoImageView.clipsToBounds = YES;
}

- (void)updateWithURL:(NSString *)urlString {
    NSURL *url = [NSURL URLWithString:urlString];
    if(url) {
        [_photoImageView setImageWithURL:url];
    }
}

- (void)updateWithImage:(UIImage *)image {
    _photoImageView.image = image;
}

@end
